home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / findch2r / frmdelet.frm (.txt) < prev    next >
Visual Basic Form  |  1999-08-13  |  2KB  |  69 lines

  1. VERSION 5.00
  2. Begin VB.Form frmDeleteFavorite 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "Select a favorite to delete."
  5.    ClientHeight    =   3090
  6.    ClientLeft      =   60
  7.    ClientTop       =   405
  8.    ClientWidth     =   4680
  9.    Icon            =   "frmDeleteFavorite.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    ScaleHeight     =   3090
  13.    ScaleWidth      =   4680
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.CommandButton cmdDelete 
  16.       Caption         =   "Delete Favorite"
  17.       Height          =   375
  18.       Left            =   600
  19.       TabIndex        =   2
  20.       Top             =   2640
  21.       Width           =   1455
  22.    End
  23.    Begin VB.CommandButton cmdDone 
  24.       Caption         =   "Done"
  25.       Height          =   375
  26.       Left            =   2640
  27.       TabIndex        =   1
  28.       Top             =   2640
  29.       Width           =   1575
  30.    End
  31.    Begin VB.ListBox List1 
  32.       Height          =   2400
  33.       Left            =   120
  34.       TabIndex        =   0
  35.       Top             =   120
  36.       Width           =   4455
  37.    End
  38. Attribute VB_Name = "frmDeleteFavorite"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdCancel_Click()
  44. frmDeleteFavorite.Hide
  45. End Sub
  46. Private Sub cmdDone_Click()
  47.     frmDeleteFavorite.Hide
  48. End Sub
  49. Private Sub cmddelete_Click()
  50. Dim rownumber As Integer
  51.     x = List1.List(ListIndex)
  52.     rownumber = List1.ListIndex
  53.     List1.List(rownumber) = ""
  54. rownumber = 0
  55. On Error GoTo errorhandler
  56.     Open App.Path + "\Favorites" For Output As #1
  57.         Do Until List1.List(rownumber) = ""
  58.             favorite = List1.List(rownumber)
  59.                 Write #1, favorite
  60.             rownumber = rownumber + 1
  61.         Loop
  62.     Close #1
  63. errorhandler:
  64.     Exit Sub
  65. End Sub
  66. Private Sub List1_Click()
  67.     cmdDelete.Enabled = True
  68. End Sub
  69.